home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Tools / freeWAIS-sf-1.1 / ui / document.h < prev    next >
C/C++ Source or Header  |  1994-08-04  |  3KB  |  86 lines

  1. /* WIDE AREA INFORMATION SERVER SOFTWARE:
  2.    No guarantees or restrictions.  See the readme file for the full standard
  3.    disclaimer.
  4.  
  5.    This is part of the user-interface for the WAIS software.  Do with it
  6.    as you please.
  7.  
  8.    jonathan@Think.COM
  9. */
  10.  
  11. /* Copyright (c) CNIDR (see ../COPYRIGHT) */
  12.  
  13. /*
  14.  * $Log: document.h,v $
  15.  * Revision 1.2  1994/08/05  07:29:56  pfeifer
  16.  * Release beta 04
  17.  *
  18.  * Revision 1.1  93/06/23  20:02:31  warnock
  19.  * Initial revision
  20.  * 
  21.  * Revision 1.1  1993/02/16  15:09:27  freewais
  22.  * Initial revision
  23.  *
  24.  * Revision 1.2  92/03/17  14:37:32  jonathan
  25.  * Cleaned up for use with X interface as well.
  26.  * Prototyped everything.
  27.  * 
  28.  *
  29.  */
  30.  
  31. #ifndef _H_DOCUMENT
  32. #define _H_DOCUMENT
  33.  
  34. #include <docid.h>
  35. #include "source.h"
  36.  
  37. typedef struct CRetDocument
  38.  { 
  39.    /* instance variables */
  40.    DocID *id;
  41.    SourceID sourceID;
  42.    any*            myConnection;                /* really a ConnectionID but circular includes preclude that */
  43.    long             numLines;                    /* number of lines in document */
  44.    long             numChars;                   /* number of characters */
  45.    char         *blocks,*pendingBlocks;     /* lists of CLineBlocks */
  46.    long             best;
  47.    char        *source,*headline,*city,*stock,*company,*industry, **type, *date;
  48.    struct CRetDocument     *next,*prev;                 /* linked docs if there are any */
  49.    char            *paraStarts;                    /* i'th paragraph starts at line paraStarts[i] 
  50.                                                       -1 terminated 
  51.                                                     */
  52.    
  53.  } _CRetDocument, *CRetDocument;
  54.  
  55. typedef struct DocumentID {
  56.   short rawScore, normalScore;
  57.   long start, end;
  58.   CRetDocument doc;
  59. } _DocumentID, *DocumentID;
  60.  
  61. typedef struct doclist {
  62.   DocumentID thisDoc;
  63.   struct doclist *nextDoc;
  64. } _DocList, *DocList;
  65.  
  66. /* functions */
  67.  
  68. void freeItemList _AP((char** list));
  69. char **buildDocumentItemList _AP((DocList doclist, Boolean scorep));
  70. DocList ReadListOfDocuments _AP((FILE* file));
  71. short ReadFragment _AP((FILE* file, long* dest));
  72. short ReadDoc _AP((FILE* file, CRetDocument doc));
  73. short ReadDocument _AP((DocumentID doc, FILE* file));
  74. CRetDocument MakeNewDocument _AP((void));
  75. DocList makeDocList _AP((DocumentID doc, DocList rest));
  76. DocumentID copy_docid _AP((DocumentID doc));
  77. void WriteDocument _AP((DocumentID doc, FILE* fp));
  78. void sort_document_list _AP((DocList dlist));
  79. DocList findLast _AP((DocList dlist));
  80. DocumentID findDoc _AP((DocList dlist, int number));
  81. DocumentID fillDocumentID _AP((WAISDocumentHeader* docHeader,SourceID source));
  82. void freeDocumentID _AP((DocumentID doc));
  83. void freeDocList _AP((DocList doclist));
  84.  
  85. #endif
  86.